<template>
	<view class="card_ec">
		<!-- 二级分类 删除 置顶 -->
		<view class="margin flex justify-between align-center">
			    <slot v-if="headerLeftSlot"  name="headerLeft"/>
				<view v-else>
					<text v-if="label" class="text-orange text-bold">{{label}}</text>
					<view v-else class="rloading" style="height: 40upx;width: 200upx;"></view>
					<text v-if="label && type!='EarGrinding'" @click="$emit('delete')" class="cuIcon-delete margin-left-xs text-gray"></text>
				</view>
				<slot v-if="headerRightSlot" name="headerRight"></slot>
				<view  v-else>
					<text v-if="label && type!='Del' && type!='EarGrinding'" @click="$emit('top')" class="cuIcon-top text-gray"></text>
					<text v-if="type=='Del' " @click="$emit('recover')" class="cuIcon-refresh text-gray"></text>
				</view>
		</view>
		<slot ></slot>
	</view>
</template>

<script>
	export default {
		props: {
			type:String,
			label: String,
			headerLeftSlot: Boolean,
			headerRightSlot:Boolean,
		},
		methods: {
			// 跳转书架页面
			bookcaseNav() {
				uni.navigateTo({
					url: '/pages/Bookcase/index'
				})
			}
		}
	}
</script>

<style lang="scss">
	.card_ec {
		width: 100vw;
		overflow: hidden;
		.card_ec-body{
			width: 100vw;
			padding: 0 30upx 30upx;
			box-sizing: border-box;
			overflow: hidden;
		}
	}
</style>